package com.bw.controller;


import com.bw.entity.Bing;
import com.bw.entity.Dict;
import com.bw.entity.Zxt;
import com.bw.mapper.TuMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class TuController {

    @Autowired
    TuMapper tuMapper;


    @RequestMapping("tu.do")
    public String tu(Model model) {
        // 把职级下拉框 数据返回
        List<Dict> gradeList = tuMapper.listGrade();
        model.addAttribute("gradeList", gradeList);
        return "tu";
    }

    @RequestMapping("zxt.do")
    @ResponseBody
    public List<Zxt> zxt(Integer gradeId, String remark) {

        return tuMapper.zxt(gradeId, remark);
    }
    @RequestMapping("bing.do")
    @ResponseBody
    public List<Bing> bing(Integer gradeId, String remark) {

        return tuMapper.bing(gradeId, remark);
    }


}
